public class q30 {
    public static void main(String[] args) {
        int a=0;
        int b=0;
        while (a<=1000){
            if (a%7==0){
                b+=a;
            }  a++;
        }System.out.println(b);
    }
}
